//存储一些自定义的ICON图标
// ctrl + k + 0 快速折叠代码

import type { CustomIconComponentProps } from "@ant-design/icons/lib/components/Icon";
import Icon from "@ant-design/icons";
import { mergeObj } from "@/lib/util";
type OtherProps = {
  /**图标的大小，会转换为style-fontSize写入组件 */
  size?: number;
  /**图标的颜色，会转换为style-color写入组件 */
  color?: string;
};
/**创建一个icon组件，传入svg代码
 * @param Svg 符合条件的svg代码
 * @tip 条件
 * 基于SVG，可以在 https://www.iconfont.cn/ 上寻找喜欢的图标，然后复制svg代码
 * 1. 把复制下来的代码中svg的属性，t和class删掉，就可以没有ts报错，然后宽高改为1em
 * 2. 如果需要颜色跟随自己定制的颜色，需要给svg的path标签的fill属性设置为"currentColor"
 * @returns
 */
export const createIcon = (Svg: JSX.Element) => {
  return function _Icon(props: Partial<CustomIconComponentProps> & OtherProps) {
    const { size, color, style = {}, ...IconProps } = props;
    const realStyle = mergeObj({ fontSize: size, color }, style);
    return <Icon component={() => Svg} {...IconProps} style={realStyle} />;
  };
};
export default createIcon;
/**Icon图标的样式 */
export type IconType = React.ForwardRefExoticComponent<any> | React.FC<Partial<CustomIconComponentProps>>;

/**彩色的视频图标 */
export const ColorVideoIcon = createIcon(
  <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6795" width="1em" height="1em">
    <path d="M21.333329 405.333462l981.333129 0 0 597.333209-981.333129 0 0-597.333209Z" fill="#9FDBAD" p-id="6796"></path>
    <path
      d="M959.9998 426.666791a21.333329 21.333329 0 0 1 21.333329 21.333329v511.999893a21.333329 21.333329 0 0 1-21.333329 21.333329H63.999987a21.333329 21.333329 0 0 1-21.333329-21.333329V448.00012a21.333329 21.333329 0 0 1 21.333329-21.333329h895.999813m0-42.666658H63.999987a63.999987 63.999987 0 0 0-63.999987 63.999987v511.999893a63.999987 63.999987 0 0 0 63.999987 63.999987h895.999813a63.999987 63.999987 0 0 0 63.999987-63.999987V448.00012a63.999987 63.999987 0 0 0-63.999987-63.999987z"
      fill="#5C2D51"
      p-id="6797"
    ></path>
    <path
      d="M66.986653 407.040129a15.999997 15.999997 0 0 1-15.359997-11.946665L21.333329 281.600155a15.999997 15.999997 0 0 1 11.519997-19.626663L951.679802 21.333542h4.053332a15.999997 15.999997 0 0 1 15.359997 11.946664l29.653327 113.49331a15.999997 15.999997 0 0 1-11.519997 19.626663L71.039985 406.613462z"
      fill="#FFFFFF"
      p-id="6798"
    ></path>
    <path
      d="M951.893135 43.946871l27.093328 103.253312L70.826652 384.000133l-26.879994-102.613312L951.893135 43.946871M955.733134 0.000213a37.333326 37.333326 0 0 0-9.386664 1.28L27.946661 241.493496a37.333326 37.333326 0 0 0-26.666661 45.439991l29.653327 113.49331A37.333326 37.333326 0 0 0 76.373317 426.666791L994.986459 186.880174a37.333326 37.333326 0 0 0 26.666661-45.653323L991.999793 27.946874A37.333326 37.333326 0 0 0 955.733134 0.000213z"
      fill="#5C2D51"
      p-id="6799"
    ></path>
    <path
      d="M177.493296 224.426833l78.933317-20.693329 9.173332 151.893302-78.933317 20.693329-9.173332-151.893302z"
      fill="#F05071"
      p-id="6800"
    ></path>
    <path
      d="M236.799951 230.826832l6.399998 108.586644-36.906659 9.599998-6.399998-108.586644 36.906659-9.599998m39.466658-54.399989L155.306634 208.213503l11.519998 195.413293 120.959975-31.573327-11.519998-195.413292z"
      fill="#5C2D51"
      p-id="6801"
    ></path>
    <path
      d="M369.919923 174.080177l78.933317-20.693329 8.959998 152.106635-78.933317 20.479996-8.959998-151.893302z"
      fill="#F05071"
      p-id="6802"
    ></path>
    <path
      d="M429.013244 180.693509l6.399999 108.586644-36.693326 9.386665-6.399999-108.586644 36.906659-9.599998M469.333236 126.29352L347.519928 157.866847l11.519997 195.413293 120.959975-31.573327-10.666664-195.413293z"
      fill="#5C2D51"
      p-id="6803"
    ></path>
    <path
      d="M562.133216 123.733521l78.933317-20.693329 9.173332 152.106635-79.146651 20.693329-8.959998-152.106635z"
      fill="#F05071"
      p-id="6804"
    ></path>
    <path
      d="M621.439871 130.346853l6.399998 108.586644-36.906659 9.599998-6.399998-108.586644 36.906659-9.599998M661.333196 75.946864L539.946554 106.666858l11.519998 195.413292 120.959975-31.573326L661.333196 75.946864z"
      fill="#5C2D51"
      p-id="6805"
    ></path>
    <path
      d="M754.559843 73.386865l78.719983-20.479996 9.173332 151.893302-78.933317 20.693329-8.959998-152.106635z"
      fill="#F05071"
      p-id="6806"
    ></path>
    <path
      d="M813.653164 80.000197l6.399998 108.586644-36.906658 9.599998-6.399999-108.586644 36.906659-9.599998M853.333156 25.600208l-121.173309 31.573327 11.519998 195.413292 120.959975-31.573326L853.333156 25.600208z"
      fill="#5C2D51"
      p-id="6807"
    ></path>
    <path
      d="M429.013244 842.026705a42.666658 42.666658 0 0 1-42.666658-42.666658v-189.866627a42.666658 42.666658 0 0 1 42.666658-42.666658 42.666658 42.666658 0 0 1 21.333329 5.759999l165.973299 94.933313a42.666658 42.666658 0 0 1 0 74.666651l-165.973299 94.079981a42.666658 42.666658 0 0 1-21.333329 5.759999z"
      fill="#FDCA89"
      p-id="6808"
    ></path>
    <path
      d="M429.013244 587.306758a21.333329 21.333329 0 0 1 10.666664 2.986666l165.973299 94.933313a21.333329 21.333329 0 0 1 0 37.759992l-165.973299 94.933314a21.333329 21.333329 0 0 1-10.666664 2.986666 21.333329 21.333329 0 0 1-21.333329-21.333329v-189.866627a21.333329 21.333329 0 0 1 21.333329-21.333329m0-42.666658a63.999987 63.999987 0 0 0-63.999987 63.999987v189.866627a63.999987 63.999987 0 0 0 96.426647 55.893322l165.973299-94.933314a63.999987 63.999987 0 0 0 0-111.786643l-165.973299-94.933314a63.999987 63.999987 0 0 0-31.78666-8.533331z"
      fill="#5C2D51"
      p-id="6809"
    ></path>
  </svg>
);
/**彩色的图片图标 */
export const ColorImageIcon = createIcon(
  <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10530" width="1em" height="1em">
    <path
      d="M124.7744 757.1968l150.2208-147.0976c20.736-20.3264 54.272-19.3024 73.7792 2.2016l66.0992 72.96c19.8656 21.9136 54.1696 22.4768 74.752 1.2288l194.9696-201.5744c20.4288-21.0944 54.3744-20.736 74.3424 0.768l148.8896 160.6144v187.9552s-2.5088 75.8272-105.7792 75.8272H208.9984s-84.224-9.1648-84.224-92.8256v-60.0576z"
      fill="#ffa115"
      p-id="10531"
    ></path>
    <path
      d="M369.2032 474.2144c62.3616 0 113.0496-50.7392 113.0496-113.0496s-50.7392-113.0496-113.0496-113.0496-113.0496 50.7392-113.0496 113.0496 50.7392 113.0496 113.0496 113.0496z m0-164.7104c28.4672 0 51.6096 23.1424 51.6096 51.6096s-23.1424 51.6096-51.6096 51.6096-51.6096-23.1424-51.6096-51.6096 23.1424-51.6096 51.6096-51.6096z"
      fill="#474A54"
      p-id="10532"
    ></path>
    <path
      d="M819.8656 82.0224H208.9984c-73.4208 0-133.12 59.6992-133.12 133.12v592.64c0 73.4208 59.6992 133.12 133.12 133.12h610.9184c73.4208 0 133.12-59.6992 133.12-133.12V215.1424c-0.0512-73.4208-59.7504-133.12-133.1712-133.12z m-610.8672 61.44h610.9184c39.5264 0 71.68 32.1536 71.68 71.68V583.68l-110.08-118.784a82.048 82.048 0 0 0-59.1872-26.2144h-0.8704c-22.1184 0-43.52 9.0624-58.88 24.9856l-194.9696 201.5744c-3.9936 4.096-9.2672 6.144-15.0528 6.2464a20.4544 20.4544 0 0 1-14.848-6.7072l-66.0992-72.96c-15.104-16.64-35.7888-26.2144-58.2656-26.88-22.4256-0.6656-43.6736 7.6288-59.7504 23.3472l-116.2752 113.664V215.1424c0-39.5264 32.1536-71.68 71.68-71.68z m610.8672 736H208.9984c-39.5264 0-71.68-32.1536-71.68-71.68v-22.5792a30.208 30.208 0 0 0 8.96-5.9904l150.2208-147.0976c3.9936-3.9424 9.3184-5.9392 14.9504-5.8368 5.632 0.1536 10.8032 2.56 14.592 6.7072l66.0992 72.96c15.1552 16.7424 36.8128 26.5216 59.3408 26.88 22.6816 0.1536 44.544-8.704 60.2112-24.9344l194.9696-201.5744c3.8912-4.0448 9.1136-6.2464 14.6944-6.2464h0.2048c5.6832 0.0512 10.9568 2.4064 14.7968 6.5536l148.8896 160.6144c1.8944 2.048 4.0448 3.6352 6.2976 5.0688v135.424c0 39.5776-32.1536 71.7312-71.68 71.7312z"
      fill="#474A54"
      p-id="10533"
    ></path>
  </svg>
);
/**彩色的文字图标 */
export const ColorTextIcon = createIcon(
  <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="22681" width="1em" height="1em">
    <path
      d="M821.400722 942.593945h-7.375991c-22.476921 0-42.587957-13.967106-50.436716-35.029817l-61.736063-165.670204c-7.848759-21.062711-27.958772-35.029818-50.436716-35.029818H368.32474c-22.848381 0-43.207058 14.425547-50.78157 35.982516l-57.540508 163.765831c-7.574512 21.556968-27.933189 35.982516-50.78157 35.982516h-6.620791c-37.697577 0-63.717184-37.752836-50.299593-72.982198L439.295118 116.068506c7.950066-20.8734 27.963888-34.667567 50.299593-34.667568h44.810578c22.335704 0 42.35055 13.794168 50.299593 34.667568l286.99441 753.543241c13.418614 35.229362-12.600993 72.982198-50.29857 72.982198zM494.209822 251.526617L391.187447 537.502837c-12.636808 35.07689 13.355169 72.067362 50.63933 72.067362h135.677099c37.346583 0 63.342654-37.105083 50.588166-72.206532L524.231579 251.526617a33.022091 33.022091 0 0 1-0.181125-0.52291c-4.951779-14.642488-25.703405-14.370289-29.840632 0.52291z"
      fill="#F7D11E"
      p-id="22682"
    ></path>
    <path
      d="M821.399699 958.708971h-7.379061c-29.045523 0-55.369052-18.291598-65.518203-45.519729L686.744883 747.514945c-5.459339-14.672164-19.667945-24.537859-35.323507-24.537859H368.329856c-15.986089 0-30.28884 10.132778-35.590589 25.214264l-57.540508 163.762761c-9.818623 27.959795-36.33044 46.75486-65.973574 46.75486h-6.623861a69.940932 69.940932 0 0 1-57.587579-30.257117 69.920466 69.920466 0 0 1-7.773034-64.573691L424.234097 110.329804C434.492742 83.392292 460.753849 65.290005 489.594711 65.290005h44.811602c28.840862 0 55.101969 18.102287 65.360613 45.039799L886.760313 863.878163a69.920466 69.920466 0 0 1-7.773034 64.573691 69.940932 69.940932 0 0 1-57.58758 30.257117zM368.329856 690.753173h283.092544c29.045523 0 55.384401 18.291598 65.518202 45.511544l61.757553 165.674296c5.460362 14.680351 19.667945 24.546046 35.323506 24.546046h7.379061c12.58769 0 23.916712-5.947456 31.05939-16.316617 7.143701-10.360975 8.66945-23.059182 4.185322-34.82004L569.650001 121.800044c-5.522784-14.530948-19.699668-24.286126-35.244712-24.286126h-44.811602c-15.545044 0-29.721929 9.755178-35.244712 24.286126L167.354566 875.348402c-4.484128 11.761881-2.958378 24.459065 4.185322 34.82004 7.143701 10.369162 18.4717 16.316617 31.05939 16.316617h6.623861c15.986089 0 30.272467-10.132778 35.57524-25.206078L302.33991 737.499847c9.833973-27.959795 36.362162-46.746674 65.989946-46.746674z m209.171974-65.068971H441.824731c-22.75219 0-44.135196-11.107989-57.20998-29.721928-13.091156-18.622126-16.284895-42.514279-8.575306-63.920822l103.013165-285.971104c3.477194-12.697183 15.687284-21.99699 30.020734-21.99699 13.893428 0 25.756617 8.543583 30.241768 21.760607L643.22367 531.860327c7.788383 21.414729 4.641717 45.346791-8.434089 64.014966-13.074783 18.661012-34.488489 29.80891-57.287751 29.808909z m-68.318992-368.356462L406.343635 542.961152c-4.217045 11.713786-2.533706 24.27794 4.626367 34.474163 7.15905 10.17985 18.409279 16.024975 30.854729 16.024975h135.677099c12.477172 0 23.727401-5.861498 30.886451-16.073071 7.15905-10.219759 8.81169-22.799262 4.562922-34.521234L509.182838 257.32774z m-0.109494-17.142426l-0.015349 16.111956h0.031722l-0.016373-16.111956z"
      fill="#885F44"
      p-id="22683"
    ></path>
  </svg>
);

export const AIGC = createIcon(
  <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4254" width="1em" height="1em"><path d="M913.067 465.92c-13.654 0-25.6-11.947-25.6-25.6V322.56c0-15.36-8.534-30.72-22.187-37.547L537.6 93.867c-13.653-8.534-30.72-8.534-44.373 0L163.84 283.307c-13.653 8.533-22.187 22.186-22.187 37.546v64.854c0 13.653-11.946 25.6-25.6 25.6s-25.6-11.947-25.6-25.6v-64.854c0-34.133 18.774-64.853 47.787-81.92l329.387-189.44c29.013-17.066 66.56-17.066 95.573 0l329.387 189.44c29.013 17.067 47.786 47.787 47.786 81.92v117.76c-1.706 15.36-11.946 27.307-27.306 27.307zM515.413 988.16c-17.066 0-32.426-3.413-47.786-11.947L138.24 785.067C109.227 768 90.453 737.28 90.453 703.147V593.92c0-13.653 11.947-25.6 25.6-25.6s25.6 11.947 25.6 25.6v109.227c0 15.36 8.534 30.72 22.187 37.546l329.387 189.44c13.653 8.534 30.72 8.534 44.373 0l329.387-189.44c13.653-8.533 22.186-22.186 22.186-37.546v-71.68c0-13.654 11.947-25.6 25.6-25.6s23.894 10.24 23.894 25.6v71.68c0 34.133-18.774 64.853-47.787 81.92L563.2 974.507c-15.36 8.533-32.427 13.653-47.787 13.653z" fill="#5374A0" p-id="4255"></path><path d="M597.333 645.12h-73.386l-23.894-71.68H385.707l-23.894 71.68h-73.386l114.346-314.027h78.507L597.333 645.12zM486.4 520.533l-35.84-109.226c-1.707-6.827-3.413-15.36-5.12-27.307h-1.707c0 8.533-3.413 18.773-5.12 27.307l-35.84 109.226H486.4z m218.453-191.146v314.026h-66.56V329.387h66.56z" fill="#333333" p-id="4256"></path><path d="M42.667 544.427a69.973 69.973 0 1 0 139.946 0 69.973 69.973 0 1 0-139.946 0zM841.387 467.627a69.973 69.973 0 1 0 139.946 0 69.973 69.973 0 1 0-139.946 0z" fill="#5374A0" p-id="4257"></path><path d="M814.08 646.827V377.173c0-23.893-13.653-46.08-34.133-59.733L546.133 182.613c-20.48-11.946-47.786-11.946-68.266 0L244.053 317.44c-20.48 11.947-34.133 34.133-34.133 59.733v271.36c0 23.894 13.653 46.08 34.133 59.734l233.814 133.12c20.48 11.946 47.786 11.946 68.266 0L779.947 706.56c22.186-11.947 34.133-34.133 34.133-59.733z" fill="#A3D4FF" opacity=".3" p-id="4258"></path></svg>
)
